from building import *

cwd = GetCurrentDir()
CPPPATH = [cwd]

src = []

if GetDepend('SUPPORT_FAT_FS'):
  src += Glob('ff.c')

if GetDepend('SUPPORT_DISK_IO_DEFAULT'):
  src += Glob('diskio.c') 
  if GetDepend('MMC_USE_IO'):
    src += Glob('mmc_io_spi.c') 
elif GetDepend('SUPPORT_DISK_IO_1'):
  src += Glob('diskio1.c') 
if GetDepend('SUPPORT_DISK_IO_2'):
  src += Glob('diskio2.c') 
if GetDepend('SUPPORT_DISK_FLASH_SD'):
  src += Glob('diskio_FlashSd.c') 
if GetDepend('SUPPORT_DISK_FLASH_SDIO'):
  src += Glob('diskio_FlashSDIO.c') 

if GetDepend('SUPPORT_FAT_FS_EX'):
  src += Glob('ffex.c') 

if GetDepend('SUPPORT_FAT_FS_SYSTEM'):
  src += Glob('ffsystem.c')  

if GetDepend('SUPPORT_FAT_FS_UNICODE'):
  src += Glob('ffunicode.c')     

#增加SUPPORT_EX_PREINCLUDE定义以预包含Preinclude.h
predefine = ['SUPPORT_EX_PREINCLUDE']
group = DefineGroup('FatFS', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = predefine)
Return('group')


